#ifndef EOBJECT
#define EOBJECT
#include <sdk_global.h>
#include <QObject>
#include <QSharedPointer>
#include <QString>
#include <QList>
#include <QMetaProperty>
class ObjectInspectorItem;
class QDESIGNER_SDK_EXPORT EObject : public QObject
{
    Q_OBJECT
        Q_PROPERTY(QString EObjectName READ getEObjectName WRITE setEObjectName)
        Q_PROPERTY(bool ShowInClassList READ getShowInClassList)
public:
    EObject(QObject *parent = 0);
    virtual ~EObject();

    ObjectInspectorItem* getObjItem();
    virtual void refreshItemTest();
    QSharedPointer<EObject> getSharedPtr();
    void setEObjectName(const QString& name);
    QString getEObjectName();

    bool getShowInClassList();

    virtual void copyFrom(EObject* objPtr);
    virtual EObject* clone();

    virtual bool isTraverseChildEObject();//used when saving xml file,default = true;

    //for example, pluginOsg can rewrite this function to return a osg::object ptr,
    //and then pluginBullet can use this osgobj without depend on pluginOsg.dll
    virtual void* getRelevantPtr();

    //judge if a EObject has a parent class type ""
    virtual bool ifHasSuperClass(const QString& superClassTypeName);

    bool isRecoverProperty(const QMetaProperty& property);
protected:
    void addRecoverPropertyName(const QString& propertyName);
    QList<QString> getRecoverPropertyName();
    void setShowInClassList(bool boolValue);
private:
    ObjectInspectorItem* m_objItem;
    QList<QString> m_recoverPropertyNameList;
    bool m_showInClassList;
};

#endif // EOBJECT
